<?php
class ModuleEditAction extends AdminAction
{
	public function __construct()
	{
		parent::__construct();
		$this->layout = 'default';
	}

	public function execute()
	{
		$moduleService = new BaseDbService('module');
		
		$position = $this->context->get('position');
		if(!is_numeric($position))
		{
			$position = 0;
		}
		
		$id = $this->context->get('id');
		if(is_numeric($id) && $id)
		{
			$this->data['info']	= $moduleService->get($id);
			$position = $this->data['info']['position'];
		}
		
		$this->data['id'] = $id;
		$this->data['position'] = $position;
		
		if($position==0)
		{
			$this->data['menu'] = 'index_module';
		}
		else
		{
			//TODO 增加频道后扩展
			$this->data['menu'] = 'index_module';
		}
	}
}
